-- GENERATED SPELL FOR [Ashtongue Stormcaller] --


function spell0_22846(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(41183,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22846', 3000, 1)
end

function spell1_22846(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(41184,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22846', 2000, 1)
end

function spell2_22846(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(41151,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22846', 612, 1)
end

function Sorts_22846(pUnit, Event)
local choix_sorts_22846 = math.random(0, 2)
if choix_sorts_22846 == 0 then
pUnit:RegisterEvent('spell0_22846', 1, 1)
end
if choix_sorts_22846 == 1 then
pUnit:RegisterEvent('spell1_22846', 1, 1)
end
if choix_sorts_22846 == 2 then
pUnit:RegisterEvent('spell2_22846', 1, 1)
end
end

function mob22846_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22846', math.random(1500, 3000), 1)
end

function mob22846_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22846_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22846_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22846, 1, 'mob22846_Action')
RegisterUnitEvent(22846, 2, 'mob22846_Leave')
RegisterUnitEvent(22846, 3, 'mob22846_Kill')
RegisterUnitEvent(22846, 4, 'mob22846_Die')
